home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************************************\
- | |
- | CVersCaption.h ©1997 John C. Daub. All rights reserved |
- | |
- | See the file "CVersCaption README" for full details, instructions, changes, |
- | licensing agreement, etc. Due to the important information included in that |
- | file, if you did not receive a copy of it, please contact the author for |
- | a copy. |
- | |
- | John C. Daub <mailto:hsoi@eden.com> |
- | <http://www.eden.com/~hsoi/> <http://www.eden.com/~hsoi/prog.html> |
- | |
- \*******************************************************************************/
-
- #ifndef _H_CVersCaption
- #define _H_CVersCaption
-
- #pragma once
-
- #if defined(__CFM68K__) && !defined(__USING_STATIC_LIBS__)
- #pragma import on
- #endif
-
- #include <PP_Prefix.h>
- #include <LCaption.h>
-
- enum {
- STR_dot = 9500, // the period/seperator between numbers
- STR_devel = 9501, // "1.1d1"
- STR_alpha = 9502, // "1.1a1"
- STR_beta = 9503, // "1.1b1"
- STRx_countries = 9500 // the STR# with the country codes, index == code
-
- };
-
- class CVersCaption : public LCaption {
-
- public:
-
- enum { class_ID = 'VCpt' };
-
- #if ( __PowerPlant__ < 0x01608000 ) // version 1.6/CW11
- static CVersCaption* CreateFromStream( LStream *inStream );
- #endif
- CVersCaption();
- CVersCaption( const CVersCaption &inOriginal );
- CVersCaption( const SPaneInfo &inPaneInfo,
- ConstStringPtr inString,
- ResIDT inTextTraitsID,
- Boolean inUseShortString = false,
- Boolean inUseCountryCode = false );
- CVersCaption( LStream *inStream );
-
- virtual ~CVersCaption();
-
- CVersCaption& operator=( const CVersCaption &inOriginal );
-
-
- // these are public in case someone might need them, but I
- // generally wouldn't recommend their use
-
- virtual Uint32 GetVersion() const;
- virtual void SetVersion( const Uint32 inVersion );
-
-
- protected:
-
- virtual void DrawSelf();
-
- virtual void ActivateSelf();
- virtual void DeactivateSelf();
-
-
- // these accessors made protected. I can't see the outside
- // needing this information, but subclasses might
-
- virtual Boolean GetUseShortString() const;
- virtual void SetUseShortString( const Boolean inUseShortString );
-
- virtual Boolean GetUseCountryCode() const;
- virtual void SetUseCountryCode( const Boolean inUseCountryCode );
-
-
- private:
-
- void InitVersCaption();
-
- Uint32 mVersion;
- Boolean mUseShortString;
- Boolean mUseCountryCode;
-
-
- };
-
- //========================================================================
- // ••• CVersCaption inline functions
- //========================================================================
-
-
- //========================================================================
- // • GetVersion [public]
- //========================================================================
- // Returns the version as a Uint32 (NumVersion)
-
- inline
- Uint32
- CVersCaption::GetVersion() const
- {
- return mVersion;
- }
-
-
- //========================================================================
- // • SetVersion [public]
- //========================================================================
- // Sets the version to the given Uint32 (NumVersion)
-
- inline
- void
- CVersCaption::SetVersion(
- const Uint32 inVersion )
- {
- mVersion = inVersion;
- }
-
-
- //========================================================================
- // • GetUseShortString [protected]
- //========================================================================
- // Returns if we're using the shortString or not
-
- inline
- Boolean
- CVersCaption::GetUseShortString() const
- {
- return mUseShortString;
- }
-
-
- //========================================================================
- // • SetUseShortString [protected]
- //========================================================================
- // Sets the use of the short string to true or false
-
- inline
- void
- CVersCaption::SetUseShortString(
- const Boolean inUseShortString )
- {
- mUseShortString = inUseShortString;
- }
-
-
- //========================================================================
- // • GetUseCountryCode [protected]
- //========================================================================
- // Returns if we're printing country codes or not
-
- inline
- Boolean
- CVersCaption::GetUseCountryCode() const
- {
- return mUseCountryCode;
- }
-
-
- //========================================================================
- // • SetUseCountryCode [protected]
- //========================================================================
- // Sets the use of the country code to true or false
-
- inline
- void
- CVersCaption::SetUseCountryCode(
- const Boolean inUseCountryCode )
- {
- mUseCountryCode = inUseCountryCode;
- }
-
-
-
- #if defined(__CFM68K__) && !defined(__USING_STATIC_LIBS__)
- #pragma import reset
- #endif
-
- #endif // _H_CVersCaption